package com.yanqu.road.entity.grandchild;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;

import java.util.Objects;
import java.util.Set;

/**
 * 科举基础数据
 */
@FieldTypeAnnotation(tableName = "t_c_grand_child_exam_data")
public class GrandChildExamData extends DataObject {

    @FieldTypeAnnotation(desc = "科举全局ID", select = true, update = true)
    private long globalId;
    @FieldTypeAnnotation(desc = "分组ID")
    private int groupId;
    @FieldTypeAnnotation(desc = "区服ID")
    private Set<Long> serverList;
    @FieldTypeAnnotation(desc = "开启时间")
    private long openTime;
    @FieldTypeAnnotation(desc = "结束时间")
    private long finishTime;
    @FieldTypeAnnotation(desc = "开启时间星期参数")
    private String openTimeParam;

    public String getOpenTimeParam() {
        return openTimeParam;
    }

    public void setOpenTimeParam(String openTimeParam) {
        if (!Objects.equals(this.openTimeParam, openTimeParam)) {
            this.openTimeParam = openTimeParam;
            setUpdateOption();
        }
    }

    public long getGlobalId() {
        return globalId;
    }

    public void setGlobalId(long globalId) {
        if (this.globalId != globalId) {
            this.globalId = globalId;
            setOp(DataStatus.Update);
        }
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        if (this.groupId != groupId) {
            this.groupId = groupId;
            setOp(DataStatus.Update);
        }
    }

    public Set<Long> getServerList() {
        return serverList;
    }

    public void setServerList(Set<Long> serverList) {
        if (null == serverList) {
            return;
        }
        this.serverList = serverList;
        setOp(DataStatus.Update);
    }

    public long getOpenTime() {
        return openTime;
    }

    public void setOpenTime(long openTime) {
        if (this.openTime != openTime) {
            this.openTime = openTime;
            setOp(DataStatus.Update);
        }
    }

    public long getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(long finishTime) {
        if (this.finishTime != finishTime) {
            this.finishTime = finishTime;
            setOp(DataStatus.Update);
        }
    }
}
